Chris Pollett > Old Classes >
CS175

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Mid]  [Final]

                           












HW#4 --- last modified February 07 2019 04:23:55..

Solution set.

Due date: Nov 19

Files to be submitted:
  Hw4.zip

Purpose:

Related Course Outcomes:

LO4 -- Write a mobile application that uses a either the camera, location, or device graphics API.

LO5 -- Write a mobile application that stores program data persistently using an API like sqlite.

Specification:

For this homework I would like to make a snakes-like video game that makes use of either the 2D or OpenGL graphics APIs we learned in class. As usual you can get a bonus point if you do this app for more than one platform from among Android, iOS, and HTML 5. Homework submission is the same as with HW3. Your app when launched should have a main screen which lists the current high score and has a button Start Game. The high score should be persisted using sqlite in a simple one row one column table called HIGH_SCORE. I am insisting on sqlite just in case you were using some other persistence mechanism on an earlier homework. Clicking start game causes a game to start. The game screen should have the user's current score at the top as well as the number of lives they have. A player starts with three lives and a score of 0. At a minimum the score should go up when the user clears a level. The bottom of the screen should have two buttons -- one for turning left, one for turning right. Your game should always render itself in portrait mode. Around the perimeter of the game area should be a wall with two gaps midway up on the left and right hand side of the screen. To win a level a player needs to negotiate their snake which starts coming out the left-hand gap around any obstacles on the screen and make their snake exit through the right hand gap in the perimeter wall. Every so many milliseconds the snake advances so many pixels in the direction in which it is pointing leaving a snake tail behind it. In the middle of the screen, each level may have different walls that serve as obstacles. If the player's snake hits an interior wall, a perimeter wall or its own day it loses a life and start again at the same level. The two buttons at the bottom of the screen control the direction the snake's head is pointing. Initially, the snake is pointing rightward. Hitting the left button would make it so the head point up the screen, left again would make it point leftward. I.e., each left button press rotates the snake's head 90 degrees counter-clockwise. Similarly, each right click rotates the snake's head 90 degrees clockwise. If a player gets their snake's head to the right hand side gap then the level is cleared and a new level is started. You should design at least three distinct levels which your game rotates through, also as the level number goes up the snakes speed should increase. If the live count goes to 0 a game over message should be displayed for 3 seconds after which the main screen should be returned to. Here is an ASCII character mock up of what a screen might look like (you should use the Graphics API's not ASCII).

Liv:3  Lev:2  Sc:100
####################
#                  #
#   #####          #
# o--   #          #
#   |   #          #
-----   ########
#       #          #
#       #          #
#   #####          #
#                  #
####################
  [Left]   [Right]

For Cinequest on this homework you can continue working on issues at 3 points a pop as you did for Hw2. If you feel an issue as described is more than three points of work. You can ask me if you can split it into sub-issues. If I approve you can split the issue and then each subissue would be worth 3 points. You can do as many issues as you like. Right now, more of the iOS issues seem open. please make sure to claim the issue by adding a comment to the issue on GitHub before you start working on it. As I get around to it, I will then actually assign you the issue. If I merge your git pull regarding the issue, the issue is closed. Please then close the issue on GitHub.

Point Breakdown

Code reasonably documented and formatted 1pt
Code uses 2D graphics API or OpenGL to draw game screen 1pt
Main screen as described with high score and start button on it. 1pt
Start game starts a game as described. 1pt
Levels can be cleared in the method described above. Level count updated as go up in level. 1pt
At least three distinct levels, game play speeds up as go up in level 1pt
Snake motion and control of motion is as described above 1pt
Number of lives goes down if snake intersects itself or hits a wall 1pt
If live count goes to zero game ends, and after 3 second delay go to main screen. 1pt
Sqlite persistence of high scores 1pt
Total10pts